package org.example.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.example.entity.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 课程实体
 */
@Data
@TableName("sys_course")
public class CourseEntity extends BaseEntity {
    @TableId(type = IdType.AUTO)
    private Long id;//
    private String name;//课程名称
    private String description;//课程描述
    private Long teacherId;//任课教师ID
    private String type;//课程类型
    private Double credit;//学分
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date startTime;//开始时间
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+08:00")
    private Date endTime;//结束时间
    private String rules;//考勤规则
    @TableField(exist = false)
    private String teacher;//教师名
}
